=1 && !isset($_GET['sendTo']) ){ $id=$_GET['id']; //now we get the concept and conception from the database using the ID $result=database_query("SELECT concept, conception, year FROM ConceptsBeta WHERE id=$id LIMIT 1"); if($result && mysql_num_rows($result)==1){ //assign the DB info to variables $myrow=mysql_fetch_row($result); $concept=ucwords($myrow[0]); $conception=substr(strip_tags($myrow[1]), 0, 300) . "..."; $year=$myrow[2]; $ERROR=false; ?>

Email Conception

Thanks for sharing a concept in the database. Just let us know who to send it TO, your address so people can reply to YOU, and an optional message.

TO:

FROM:

Optional Message:

Never mind, cancel


Your Message

Your email will include the following and your note if you chose to include one:

()

Error\n"; echo "

We could not find a conception with the ID you supplied. Please try again soon. (103)

\n"; } } //they submitted the form so process the email elseif( isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id']>=1 && isset($_GET['sendTo']) && isset($_GET['from']) ){ $id=$_GET['id']; $sendTo=$_GET['sendTo']; $from=$_GET['from']; if( validate_email_correct($sendTo) && validate_email_correct($from) ){ $result=database_query("SELECT concept, conception, year FROM ConceptsBeta WHERE id=$id LIMIT 1"); if($result && mysql_num_rows($result)==1){ //assign the DB info to variables $myrow=mysql_fetch_row($result); $concept=ucwords($myrow[0]); $conception=html_entity_decode(substr(strip_tags($myrow[1]), 0, 300), ENT_QUOTES) . "..."; $year=$myrow[2]; $subject = "SCLCR Concept Database: $concept"; $headers = "From: no-reply@sclcr.com \r\nReply-To: $from"; $message = "$from sent you a conception from the Society for Conceptual Logistics in Communication Research (SCLCR) Concept Database.\r\n"; if($note && strlen($note)>=3) $message.= "\r\n" . stripslashes($note) . "\r\n \r\n"; $message.= "\r\n --------------------- \r\n \r\n"; $message.= $concept . " ($year) \r\n \r\n"; $message.= $conception . "\r\n \r\n"; $message.= "\r\n --------------------- \r\n \r\n"; $message.= "View the entire entry: http://www.sclcr.com/?id=$id \r\n \r\n"; $message.= "Thanks for using the SCLCR Concept Database and feel free to become a member (free, quick, and no personal info) so you can contribute to this scholarly collection of communication concepts and their visualization: http://www.sclcr.com/society/join.php"; $mailResult=mail($sendTo, $subject, $message, $headers); if($mailResult){ echo "

Thanks!

\n"; echo "

Your message has been sent to $sendTo

\n"; echo "

Return to the conception

\n"; } else{ echo "

Error

\n"; echo "

We could not find a conception with the ID you supplied. Please try again soon. (104)

\n"; } } else{ echo "

Error

\n"; echo "

We could not find a conception with the ID you supplied. Please try again soon. (102)

\n"; } } else{ echo "

Error

\n"; echo "

There was a problem with the TO email address ($sendTo) and/or the FROM address ($from) you supplied. Please verify them and try again. (101)

\n"; } } else{ echo "

Error

\n"; echo "

Oh man, something went wrong. Make sure you provide a TO and FROM email address and that you submit a valid concept ID number. Please try again soon. (100)

\n"; } include($_SERVER['DOCUMENT_ROOT'] . "/template/header.php"); ?>